package com.ys.servers.points.dao.impl;

import com.ys.servers.common.dao.BasicNoSqlDao;
import com.ys.servers.common.data.UserType;
import com.ys.servers.points.dao.UserSignInfoDao;
import com.ys.servers.points.data.UserSignInfo;
import io.vertx.core.Future;

/**
 * Created by taotao on 2017/5/24.
 */
public class UserSignInfoDaoImpl extends BasicNoSqlDao<UserSignInfo> implements UserSignInfoDao {

    @Override
    public Future<UserSignInfo> userSign(UserSignInfo userSignInfo) {
        String id = userSignInfo.getUserId() + ":" + userSignInfo.getUserType();
        userSignInfo.setId(id);
        return this.addData(userSignInfo);
    }

    @Override
    public Future<UserSignInfo> getUserSignInfo(String userId, UserType userType) {
        String id = userId + ":" + userType;
        return this.getData(id, UserSignInfo.class);
    }
}
